package com.example.ole.aspectjbase.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class AnnoAspect {
    private static final String POINTCUT_METHOD =
            "execution(@com.example.ole.aspectjbase.annotation.DemoAnnotation * *(..))";

    @Pointcut(POINTCUT_METHOD)
    public void demoAnnotation() {
    }

    @Around("demoAnnotation()")
    public void weaveJoinPoint(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        String arg = (String) proceedingJoinPoint.getArgs()[0];
        arg += "4 :D";
        Object ret = proceedingJoinPoint.proceed(new Object[]{arg});
    }
}
